Integrand size = 19, antiderivative size = 71 \[ \int \sin (e+f x) (a+b \sin (e+f x))^2 \, dx=a b x-\frac {2 \left (a^2+b^2\right ) \cos (e+f x)}{3 f}-\frac {a b \cos (e+f x) \sin (e+f x)}{3 f}-\frac {\cos (e+f x) (a+b \sin (e+f x))^2}{3 f} \]
a*b*x-2/3*(a^2+b^2)*cos(f*x+e)/f-1/3*a*b*cos(f*x+e)*sin(f*x+e)/f-1/3*cos(f *x+e)*(a+b*sin(f*x+e))^2/f
Time = 0.36 (sec) , antiderivative size = 59, normalized size of antiderivative = 0.83 \[ \int \sin (e+f x) (a+b \sin (e+f x))^2 \, dx=\frac {-3 \left (4 a^2+3 b^2\right ) \cos (e+f x)+b (12 a (e+f x)+b \cos (3 (e+f x))-6 a \sin (2 (e+f x)))}{12 f} \]
(-3*(4*a^2 + 3*b^2)*Cos[e + f*x] + b*(12*a*(e + f*x) + b*Cos[3*(e + f*x)] - 6*a*Sin[2*(e + f*x)]))/(12*f)
Time = 0.29 (sec) , antiderivative size = 77, normalized size of antiderivative = 1.08, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.263, Rules used = {3042, 3232, 27, 3042, 3213}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \sin (e+f x) (a+b \sin (e+f x))^2 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \sin (e+f x) (a+b \sin (e+f x))^2dx\) |
\(\Big \downarrow \) 3232 |
\(\displaystyle \frac {1}{3} \int 2 (b+a \sin (e+f x)) (a+b \sin (e+f x))dx-\frac {\cos (e+f x) (a+b \sin (e+f x))^2}{3 f}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {2}{3} \int (b+a \sin (e+f x)) (a+b \sin (e+f x))dx-\frac {\cos (e+f x) (a+b \sin (e+f x))^2}{3 f}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {2}{3} \int (b+a \sin (e+f x)) (a+b \sin (e+f x))dx-\frac {\cos (e+f x) (a+b \sin (e+f x))^2}{3 f}\) |
\(\Big \downarrow \) 3213 |
\(\displaystyle \frac {2}{3} \left (-\frac {\left (a^2+b^2\right ) \cos (e+f x)}{f}-\frac {a b \sin (e+f x) \cos (e+f x)}{2 f}+\frac {3 a b x}{2}\right )-\frac {\cos (e+f x) (a+b \sin (e+f x))^2}{3 f}\) |
-1/3*(Cos[e + f*x]*(a + b*Sin[e + f*x])^2)/f + (2*((3*a*b*x)/2 - ((a^2 + b ^2)*Cos[e + f*x])/f - (a*b*Cos[e + f*x]*Sin[e + f*x])/(2*f)))/3
3.2.59.3.1 Defintions of rubi rules used
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.) *(x_)]), x_Symbol] :> Simp[(2*a*c + b*d)*(x/2), x] + (-Simp[(b*c + a*d)*(Co s[e + f*x]/f), x] - Simp[b*d*Cos[e + f*x]*(Sin[e + f*x]/(2*f)), x]) /; Free Q[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(-d)*Cos[e + f*x]*((a + b*Sin[e + f*x])^m/( f*(m + 1))), x] + Simp[1/(m + 1) Int[(a + b*Sin[e + f*x])^(m - 1)*Simp[b* d*m + a*c*(m + 1) + (a*d*m + b*c*(m + 1))*Sin[e + f*x], x], x], x] /; FreeQ [{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && GtQ[m, 0] && IntegerQ[2*m]
Time = 1.28 (sec) , antiderivative size = 64, normalized size of antiderivative = 0.90
method | result | size |
derivativedivides | \(\frac {-\cos \left (f x +e \right ) a^{2}+2 a b \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-\frac {b^{2} \left (2+\sin ^{2}\left (f x +e \right )\right ) \cos \left (f x +e \right )}{3}}{f}\) | \(64\) |
default | \(\frac {-\cos \left (f x +e \right ) a^{2}+2 a b \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-\frac {b^{2} \left (2+\sin ^{2}\left (f x +e \right )\right ) \cos \left (f x +e \right )}{3}}{f}\) | \(64\) |
risch | \(a b x -\frac {a^{2} \cos \left (f x +e \right )}{f}-\frac {3 b^{2} \cos \left (f x +e \right )}{4 f}+\frac {\cos \left (3 f x +3 e \right ) b^{2}}{12 f}-\frac {a b \sin \left (2 f x +2 e \right )}{2 f}\) | \(67\) |
parallelrisch | \(\frac {\cos \left (3 f x +3 e \right ) b^{2}-6 a b \sin \left (2 f x +2 e \right )+\left (-12 a^{2}-9 b^{2}\right ) \cos \left (f x +e \right )+12 a b x f -12 a^{2}-8 b^{2}}{12 f}\) | \(67\) |
parts | \(-\frac {a^{2} \cos \left (f x +e \right )}{f}-\frac {b^{2} \left (2+\sin ^{2}\left (f x +e \right )\right ) \cos \left (f x +e \right )}{3 f}+\frac {2 a b \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )}{f}\) | \(69\) |
norman | \(\frac {a b x +a b x \left (\tan ^{6}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )-\frac {6 a^{2}+4 b^{2}}{3 f}-\frac {2 a^{2} \left (\tan ^{4}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}-\frac {\left (4 a^{2}+4 b^{2}\right ) \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}-\frac {2 a b \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{f}+\frac {2 a b \left (\tan ^{5}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}+3 a b x \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+3 a b x \left (\tan ^{4}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{\left (1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )^{3}}\) | \(165\) |
1/f*(-cos(f*x+e)*a^2+2*a*b*(-1/2*sin(f*x+e)*cos(f*x+e)+1/2*f*x+1/2*e)-1/3* b^2*(2+sin(f*x+e)^2)*cos(f*x+e))
Time = 0.30 (sec) , antiderivative size = 55, normalized size of antiderivative = 0.77 \[ \int \sin (e+f x) (a+b \sin (e+f x))^2 \, dx=\frac {b^{2} \cos \left (f x + e\right )^{3} + 3 \, a b f x - 3 \, a b \cos \left (f x + e\right ) \sin \left (f x + e\right ) - 3 \, {\left (a^{2} + b^{2}\right )} \cos \left (f x + e\right )}{3 \, f} \]
1/3*(b^2*cos(f*x + e)^3 + 3*a*b*f*x - 3*a*b*cos(f*x + e)*sin(f*x + e) - 3* (a^2 + b^2)*cos(f*x + e))/f
Time = 0.12 (sec) , antiderivative size = 107, normalized size of antiderivative = 1.51 \[ \int \sin (e+f x) (a+b \sin (e+f x))^2 \, dx=\begin {cases} - \frac {a^{2} \cos {\left (e + f x \right )}}{f} + a b x \sin ^{2}{\left (e + f x \right )} + a b x \cos ^{2}{\left (e + f x \right )} - \frac {a b \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {b^{2} \sin ^{2}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {2 b^{2} \cos ^{3}{\left (e + f x \right )}}{3 f} & \text {for}\: f \neq 0 \\x \left (a + b \sin {\left (e \right )}\right )^{2} \sin {\left (e \right )} & \text {otherwise} \end {cases} \]
Piecewise((-a**2*cos(e + f*x)/f + a*b*x*sin(e + f*x)**2 + a*b*x*cos(e + f* x)**2 - a*b*sin(e + f*x)*cos(e + f*x)/f - b**2*sin(e + f*x)**2*cos(e + f*x )/f - 2*b**2*cos(e + f*x)**3/(3*f), Ne(f, 0)), (x*(a + b*sin(e))**2*sin(e) , True))
Time = 0.20 (sec) , antiderivative size = 62, normalized size of antiderivative = 0.87 \[ \int \sin (e+f x) (a+b \sin (e+f x))^2 \, dx=\frac {3 \, {\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} a b + 2 \, {\left (\cos \left (f x + e\right )^{3} - 3 \, \cos \left (f x + e\right )\right )} b^{2} - 6 \, a^{2} \cos \left (f x + e\right )}{6 \, f} \]
1/6*(3*(2*f*x + 2*e - sin(2*f*x + 2*e))*a*b + 2*(cos(f*x + e)^3 - 3*cos(f* x + e))*b^2 - 6*a^2*cos(f*x + e))/f
Time = 0.31 (sec) , antiderivative size = 60, normalized size of antiderivative = 0.85 \[ \int \sin (e+f x) (a+b \sin (e+f x))^2 \, dx=a b x + \frac {b^{2} \cos \left (3 \, f x + 3 \, e\right )}{12 \, f} - \frac {a b \sin \left (2 \, f x + 2 \, e\right )}{2 \, f} - \frac {{\left (4 \, a^{2} + 3 \, b^{2}\right )} \cos \left (f x + e\right )}{4 \, f} \]
a*b*x + 1/12*b^2*cos(3*f*x + 3*e)/f - 1/2*a*b*sin(2*f*x + 2*e)/f - 1/4*(4* a^2 + 3*b^2)*cos(f*x + e)/f
Time = 9.57 (sec) , antiderivative size = 103, normalized size of antiderivative = 1.45 \[ \int \sin (e+f x) (a+b \sin (e+f x))^2 \, dx=a\,b\,x-\frac {{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (4\,a^2+4\,b^2\right )+2\,a^2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4+2\,a^2+\frac {4\,b^2}{3}-2\,a\,b\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^5+2\,a\,b\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}{f\,{\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+1\right )}^3} \]